﻿// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Unlit/ModelTransparent"
{
		Properties
		{
			_Alpha("Alpha",Range(0,1)) = 0.8
			_Color("Tint", Color) = (1,1,1,1)
		}
		SubShader
		{
			Tags{ "RenderType" = "Transparent" "Opaque" = "Transparent" }
			LOD 100

			Pass
				{

					Cull OFF
					Blend SrcAlpha OneMinusSrcAlpha
					ZWrite Off


					CGPROGRAM

					#pragma vertex vert
					#pragma fragment frag
					#include "UnityCG.cginc"
					
					fixed4 _Color;
					float  _Alpha;
					struct a2v
					{
						float4 pos : POSITION;
						fixed4 color : COLOR;
					};

					struct v2f
					{
						float4 vertex : SV_POSITION;
						fixed4 color : COLOR;
					};



					v2f vert(a2v i)
					{
						v2f o;
						o.vertex = UnityObjectToClipPos(i.pos);
						o.color = _Color;
						return o;
					}

					fixed4 frag(v2f i) : COLOR
					{
						return fixed4(i.color.xyz,i.color.w * _Alpha);
					}

					ENDCG
				}
	}
}
